<%@page import="com.wanmait.movies.vo.Movie"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.wanmait.movies.vo.Director"%>
<%@page import="com.wanmait.movies.vo.Actor"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title> 
<% Actor actor= (Actor)request.getAttribute("actor");
   Director director =(Director)request.getAttribute("director");
  ArrayList<Movie> list = (ArrayList<Movie>)request.getAttribute("lists");
%>
<script type="text/javascript" src="/movies/js/jquery-3.5.1.min.js"></script>
<style type="text/css">
	body{
		background-color: #f5f5f5;
	}
    .onemovie{
        float: left;
        padding: 20px;
        width: 175px;
        margin: 0 10px;
        vertical-align: middle;
        text-align: center;
         
    }
    .ssp{
    	margin:25px auto;
  	    width:950px;
  	    background-color: white;
  	    overflow: hidden;
  	    border-radius: 5px; 
        	box-shadow:  0px 0px 5px rgba(0,0,0,0.1);
    }
	#first_panel img{
		width:150px;
	}
	.onemovie img{
        width: 175px;
    }
    #first_panel{
    	width:850px;
    	margin:auto;
    	padding:50px 50px;
    	background-color: white;
    	overflow:hidden;
    	border-radius: 5px; 
        	box-shadow:  0px 0px 5px rgba(0,0,0,0.1);
    }
    #first_panel .personimg{
    	margin-left:25px;
    	height: 100%;
    	width:180px;
    	float: left;
    }
    #first_panel .name{
    	margin-left:50px;
    	height: 100%;
    	width:500px;
    	float: left;
    }
     
</style>
</head>
<body>
     <jsp:include page="/include/head.jsp"></jsp:include>
     <jsp:include page="/include/neck.jsp"></jsp:include>
	 <div id="first_panel">
	
		<%
		if(actor==null&&director!=null){
			 %>
			 <div class="personimg">
			 	<span><img src="/movies/images/<%=director.getDirectorImage()%>"></span>
			 </div>
			 <div class="name">
			 	<h1><%=director.getDirectorName() %></h1>
			 	<%if(director.getDirectorIntroduce() != null){
			 			%>	<a style="color: gray; font-weight: 500 ;font-size: 13px">
			 				&emsp;&emsp;<%=director.getDirectorIntroduce() %> 
			 				</a>
			 			<%
			 		} %>
			 </div>  
	  <% }
		
		if(actor!=null&&director==null){
		%>
		      <div class="personimg">
			 	<span><img class="imgs" src="/movies/images/<%=actor.getActorImage()%>"></span>
			  </div>
			  <div class="name">
			 	<h1><%=actor.getActorName() %></h1>
			 	
			 		<%if(actor.getActorIntroduce() != null){
			 			%>	<a style="color: gray; font-weight: 500 ;font-size: 13px">
			 				&emsp;&emsp;<%=actor.getActorIntroduce() %> 
			 				</a>
			 			<%
			 		} %>
			 		
			 
			 </div>  
	    <%
	    }
		%>
	</div>
	<br>
	<div class="ssp"> 
 	<h1>&emsp; 作品</h1>
                <%
					for(Movie m : list){
						%>
						<div class="onemovie">
                    	<a href="/movies/MoviesServlet?action=showovies&movieId=<%=m.getId()%>">	<img src="<%=request.getContextPath() %>/images/<%=m.getMovieImage() %>"></a>
                    		<%=m.getMovieName() %>
               			</div>
						<%
					}
				%>
            </div>
</body>
</html>